package com.example.commons.entity;

import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * @program: authority-v3.0.7
 * @ClassName:Collect
 * @description: 收藏 实体类
 * @author:dyy
 * @Version 3.0
 **/

@Data
@Builder(toBuilder = true)
@AllArgsConstructor
@NoArgsConstructor
@TableName("sys_collect")
@Schema(title = "Collect对象", description = "攻略收藏")
public class Collect implements Serializable {
    private static final long serialVersionUID = 1L;

    @Schema(title = "序列号")
    @TableId(value = "id", type = IdType.AUTO)
    @ExcelProperty("序列号")
    private Long id;

    @Schema(title = "收藏账户")
    @TableField("uid")
    @ExcelProperty("收藏账户")
    private Long uid;

    @Schema(title = "所属攻略")
    @TableField("aid")
    @ExcelProperty("所属攻略")
    private Long aid;

    @Schema(title = "所属视频")
    @TableField("vid")
    @ExcelProperty("所属视频")
    private Long vid;

    @Schema(title = "收藏时间")
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @ExcelProperty("收藏时间")
    private LocalDateTime createTime;

    @TableField(exist = false)
    @ExcelIgnore
    private User user = new User();

    @TableField(exist = false)
    @ExcelIgnore
    private Teach teach = new Teach();

    @TableField(exist = false)
    @ExcelIgnore
    private Video video = new Video();
}
